package com.music.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Playlist {
    private Integer plid;

    private String plname;

    private Integer uid;

    private String pic;

    private String desc;

    private Date createTime;

    private String createTimeStr;

    //歌单所有者
    private UserInfo userInfo;

    //歌单订阅者
    private List<UserInfo> favorUsers;

    private Integer subscription_count;

    private List<SingleSong> songs;

    private String songsNum;

    private Integer favoriteStatus;

    private List<Category> categories;

    public Integer getSubscription_count() {
        return subscription_count;
    }

    public void setSubscription_count(Integer subscription_count) {
        this.subscription_count = subscription_count;
    }

    public String getCreateTimeStr() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if (getCreateTime() != null) {
            return sdf.format(getCreateTime());
        } else {
            return "创建日期无";
        }
    }

    public void setCreateTimeStr(String createTimeStr) {
        this.createTimeStr = createTimeStr;
    }

    public String getSongsNum() {
        if (getSongs() == null){
            return "0";
        }else {
            return String.valueOf(getSongs().size());
        }
    }

    public void setSongsNum(String songsNum) {
        this.songsNum = songsNum;
    }

    public Integer getPlid() {
        return plid;
    }

    public void setPlid(Integer plid) {
        this.plid = plid;
    }

    public String getPlname() {
        return plname;
    }

    public void setPlname(String plname) {
        this.plname = plname == null ? null : plname.trim();
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic == null ? null : pic.trim();
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc == null ? null : desc.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    public List<UserInfo> getFavorUsers() {
        return favorUsers;
    }

    public void setFavorUsers(List<UserInfo> favorUsers) {
        this.favorUsers = favorUsers;
    }

    public List<SingleSong> getSongs() {
        return songs;
    }

    public void setSongs(List<SingleSong> songs) {
        this.songs = songs;
    }

    public List<Category> getCategories() {
        return categories;
    }

    public void setCategories(List<Category> categories) {
        this.categories = categories;
    }

    public Integer getFavoriteStatus() {
        return favoriteStatus;
    }

    public void setFavoriteStatus(Integer favoriteStatus) {
        this.favoriteStatus = favoriteStatus;
    }
}